package Enums;

public enum ReportType {
    BREW_FORECAST(0),
    CLEANING_REP(1);

    private int type;

    ReportType(final int type) {
        this.type = type;
    }

    public int getType() {
        return type;
    }

    public static ReportType getType(final String type) {
        return getType(Integer.parseInt(type));
    }

    public static ReportType getType(final int type) {
        switch (type) {
            case 0:
                return BREW_FORECAST;
            case 1:
                return CLEANING_REP;
            default:
                throw new EnumConstantNotPresentException(LabResult.class, String.valueOf(type));
        }
    }

    public static ReportType getTypeByName(final String type) {
    	if(type.equals("BREW_FORECAST")){
            return BREW_FORECAST;
    	} else if(type.equals("CLEANING_REP")){
            return CLEANING_REP;
    	} 
    	return null;
    }
}
